package com.ssy.lingxi.order.model.vo.buyer.request;

import com.ssy.lingxi.order.handler.annotation.DeliverPeriodAnnotation;
import com.ssy.lingxi.order.model.vo.basic.request.BuyerOrderConsigneeVO;
import com.ssy.lingxi.order.model.vo.basic.request.OrderInvoiceVO;
import com.ssy.lingxi.order.model.vo.basic.request.OrderPaymentVO;
import com.ssy.lingxi.order.model.vo.basic.request.OrderRequirementVO;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * 修改现货采购订单接口参数
 * @author 万宁
 * @version 2.0.0
 * @date 2021-10-22
 */
public class BuyerPurchaseOrderUpdateVO implements Serializable {
    private static final long serialVersionUID = -8130406609119575102L;

    /**
     * 订单Id
     */
    @NotNull(message = "订单Id要大于0")
    @Positive(message = "订单Id要大于0")
    private Long orderId;

    /**
     * 订单摘要
     */
    @NotBlank(message = "订单摘要不能为空")
    @Size(max = 100, message = "订单摘要最长100个字符")
    private String digest;

    /**
     * 交付日期，格式为yyyy-MM-dd，或yyyy-MM-dd HH:mm，或yyyy-MM-dd HH:mm-HH:mm
     */
    @NotBlank(message = "交付日期不能为空")
    @DeliverPeriodAnnotation(nullable = false)
    private String deliverDate;

    /**
     * 收货地址，必填
     */
    @NotNull(message = "收货地址信息不能为空")
    @Valid
    private BuyerOrderConsigneeVO consignee;

    /**
     * 发票信息，如订单没有发票不需要填写此字段
     */
    @Valid
    private OrderInvoiceVO invoice;

    /**
     * 支付信息列表，如不需要支付则不需要填写此列表
     */
    @Valid
    private List<OrderPaymentVO> payments;

    /**
     * 订单其他要求。如订单没有其他要求不需要填写此字段
     */
    private OrderRequirementVO requirement;

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public String getDeliverDate() {
        return deliverDate;
    }

    public void setDeliverDate(String deliverDate) {
        this.deliverDate = deliverDate;
    }

    public BuyerOrderConsigneeVO getConsignee() {
        return consignee;
    }

    public void setConsignee(BuyerOrderConsigneeVO consignee) {
        this.consignee = consignee;
    }

    public OrderInvoiceVO getInvoice() {
        return invoice;
    }

    public void setInvoice(OrderInvoiceVO invoice) {
        this.invoice = invoice;
    }

    public List<OrderPaymentVO> getPayments() {
        return payments;
    }

    public void setPayments(List<OrderPaymentVO> payments) {
        this.payments = payments;
    }

    public OrderRequirementVO getRequirement() {
        return requirement;
    }

    public void setRequirement(OrderRequirementVO requirement) {
        this.requirement = requirement;
    }
}
